package com.yuw.homework06;

public class ComputerStudent extends Student {

    private double optScore;
    private Double englishWrittenScore = 0.0;

    // 行为

    public ComputerStudent() {
    }

    public ComputerStudent(String stuName, String stuSex, Integer stuAge, String stuNum, Double stuMiddleScore, Double stuLastScore, Double optScore, Double englishWrittenScore) {
        super(stuName, stuSex, stuAge, stuNum, stuMiddleScore, stuLastScore);
        this.optScore = optScore;
        this.englishWrittenScore = englishWrittenScore;
    }

    public Double getOptScore() {
        return optScore;
    }

    public void setOptScore(Double optScore) {
        this.optScore = optScore;
    }

    public Double getEnglishWrittenScore() {
        return englishWrittenScore;
    }

    public void setEnglishWrittenScore(Double englishWrittenScore) {
        this.englishWrittenScore = englishWrittenScore;
    }

    @Override
    public double caculateScore() {
        return this.englishWrittenScore * 0.2 + this.optScore * 0.4
                + this.getStuMiddleScore() * 0.2 + this.getStuLastScore() * 0.2;
    }
}
